package br.com.millenium.service.funcionario.processaction;

import lumis.doui.processaction.ProcessActionHandler;
import lumis.portal.PortalException;
import br.com.millenium.domain.manager.MilleniumManagerFactory;

/*
 * 
 */
@SuppressWarnings("rawtypes")
public class CheckDeleteFuncionarioProcessActionHandler extends ProcessActionHandler
{
	@Override
	public void processAction() throws PortalException 
	{
		String[] funcionariosId = (String[])getParameter( "id" );
		
		for ( String funcionarioId: funcionariosId ) 
		{
			if ( !MilleniumManagerFactory.getFuncionarioManager().isDeleteableFuncionario( funcionarioId, transaction ) )
				throw new PortalException( "STR_FUNCIONARIO_IS_BEING_USED;", getResource( ) );
		}
	}
}